package org.syncsoft.overalt.common.api;

/**
 * provides an interface for attaching and detaching Observer objects.
 * 
 * @author tptfc
 *
 */
public interface ISubject {
	/**
	 * @precondition observer != null
	 * @postcondition observers.contains(observer) == true
	 * 
	 * @pattern observer 
	 * 
	 * @param observer
	 */
	void addObserver(final IObserver observer);
	
	/**
	 * @precondition observer != null
	 * @precondition observer != null
	 * postcondition observers.contains(observer) == false
	 * 
	 * @param observer the observer to be removed from the observers collection
	 */
	void remObserver(final IObserver observer);
	
	/**
	 * @precondition observers.isEmpty() == false
	 * @postcondition observers[0..n].update();
	 */
	void notifyAllObservers();
}
